package com.jiuxian.example2;

public class Main {

    public static void main(String[] args) {
        HandlerChain handlerChain = new DefaultHandlerChain();
        Handler handler1 = new HeaderHandler(1);
        Handler handler2 = new HeaderHandler(2);
        handlerChain.addHandler(handler1);
        handlerChain.addHandler(handler2);

        RequestSource requestSource = new RequestSource();
        requestSource.setHeader(1);
        handlerChain.doChain(requestSource);
    }
}
